"""
字典的计算：找出最大值，最小值的键值对，或者排序
"""
prices={"ACME":45.23,
        "AAPL":612.78,
        "IBM":205.55,
        "HPQ":37.20,
        "FB":10.75}

print(min(prices))
print(max(prices))
print(min(prices.values()))

#使用zip反转键值对,得到的是元素为元祖的一个列表
print(min(zip(prices.values(),prices.keys())))
print(sorted(zip(prices.values(),prices.keys())))

#计算出元素出现的次数，并排序

lst=["a","a","d","c","d","a","c","e"]
from collections import Counter
c=Counter(lst)
print(sorted(zip(c.values(),c.keys())))

